const items = [
    { title: "土壤", number: '10578', value: 45, text: '营养成分', text2: '有机质', number2: '10504' },
    { title: "温度", number: '28℃', value: 45, text: '月均温度', text2: '今日温度', number2: '26℃' },
    { title: "水分", number: '18%', value: 45, text: '月均水分', text2: '今日水分', number2: '12%' },
    { title: "湿度", number: '68%', value: 45, text: '月均湿度', text2: '今日湿度', number2: '56%' },
]
const data: any = []

for (let x of items) {
    data.push({
        backgroundColor: 'transparent',
        title: [{
            text: x.title,
            left: 20,
            top: 0,
            textAlign: 'center',
            textStyle: {
                fontWeight: 'bold',
                fontSize: '16',
                color: '#fff',
                textAlign: 'center',
            },
        }, {
            text: x.text,
            left: '27%',
            top: '48%',
            textAlign: 'center',
            textStyle: {
                fontWeight: 'bold',
                fontSize: '9',
                color: '#fff',
                textAlign: 'center',
            },
        }, {
            text: x.number,
            left: '27%',
            top: '34%',
            textAlign: 'center',
            textStyle: {
                fontWeight: 'bold',
                fontSize: '13',
                color: '#fff',
                textAlign: 'center',
            },
        }],

        series: [
            {
                type: 'pie',
                clockWise: false,
                radius: ['40%', '50%'],
                startAngle: 315,
                itemStyle: {
                    normal: {
                        color: '#07f0ff',
                        shadowColor: '#07f0ff',
                        shadowBlur: 0,

                    }
                },
                hoverAnimation: false,
                center: ['30%', '50%'],
                data: [{
                    value: x.value,
                    label: {
                        normal: {
                            formatter: function (params) {
                                return x.text2 + '\r\n' + x.number2;
                            },
                            textStyle: {
                                fontSize: '12',
                                fontWeight: 'bold',
                                color: '#fff'
                            }
                        }
                    },
                    labelLine: {
                        normal: {
                            length: 10
                        }
                    }
                }, {
                    value: 100 - x.value,
                    name: 'invisible',
                    itemStyle: {
                        normal: {
                            color: '#1c3d9c'
                        },
                        emphasis: {
                            color: '#1c3d9c'
                        }
                    },
                    label: {
                        show: false
                    },
                    labelLine: {
                        show: false
                    },
                }]
            }
        ]
    })
}
export default data